:reverselights
// vehicle struct 0@
// vahicle handle 1@
// damage manager 2@
// car driver     3@
// camX           4@
// camY           5@
// camZ           6@
// nCorona        7@
// ret nCorona
// 0AB1: @reverselights 8 struct 0@ habdle 1@ damManager 2@ driver 3@ camXYZ 4@ 5@ 6@ nCoronaIn 7@ nCoronaOut 7@
if
    3@ > 0
then
    0A8E: 20@ = 0@ + 0x48 // speed Y
    0A8D: 20@ 20@ 4 0
    if
        20@ <> 0.0
    then
        0AB8: get_vehicle 1@ current_gear_to 20@
        if
            20@ == 0
        then
            0AA8: call_function_method _getLightState struct 2@ num_params 1 pop 0 LIGHT_LEFT 21@
            0441: 8@ = car 1@ model
            if
                8A01: not model 8@ minimum_4wheels_vehicle
            then
                21@ = 0
            end
            if
                21@ <> 1
            then
                if
                    0D0C: get_car 1@ component "reversinglight_l" matrix_to 21@ // IF and SET
                then
                    0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                    21@ -= 0x10
                    if
                        17@ < 0.0
                    then
                        0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.12 with_offsets 21@ intensity 80 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                        7@ += 1
                    end
                end
                if
                    0D0C: get_car 1@ component "reversinglight_l_2" matrix_to 21@ // IF and SET
                then
                    0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                    21@ -= 0x10
                    if
                        17@ < 0.0
                    then
                        0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.12 with_offsets 21@ intensity 80 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                        7@ += 1
                    end
                end
                0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                20@ += R_L
                0A8C: 20@ 1 1 0 // TURN ON
            else
                0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                20@ += R_L
                0A8C: 20@ 1 2 0 // TURN ON
            end   
            0AA8: call_function_method _getLightState struct 2@ num_params 1 pop 0 LIGHT_RIGHT 21@
            0441: 8@ = car 1@ model
            if
                8A01: not model 8@ minimum_4wheels_vehicle
            then
                21@ = 0
            end
            if
                21@ <> 1
            then
                if
                    0D0C: get_car 1@ component "reversinglight_r" matrix_to 21@ // IF and SET
                then
                    0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                    21@ -= 0x10
                    if
                        17@ < 0.0
                    then
                        0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.12 with_offsets 21@ intensity 80 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                        7@ += 1
                    end
                end
                if
                    0D0C: get_car 1@ component "reversinglight_r_2" matrix_to 21@ // IF and SET
                then
                    0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                    21@ -= 0x10
                    if
                        17@ < 0.0
                    then
                        0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.12 with_offsets 21@ intensity 80 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                        7@ += 1
                    end
                end
                0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                20@ += R_R
                0A8C: 20@ 1 1 0 // TURN ON
            else
                0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                20@ += R_R
                0A8C: 20@ 1 2 0 // TURN ON
            end
            // trailer
            0@ += 0x4C8 
            0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
            if
                0@ > 0
            then
                0A8E: 2@ = 0@ + 0x5A0
                0AEB: 1@ = car_struct 0@ handle
                0AA8: call_function_method _getLightState struct 2@ num_params 1 pop 0 LIGHT_LEFT 21@
                0441: 8@ = car 1@ model
                if
                    8A01: not model 8@ minimum_4wheels_vehicle
                then
                    21@ = 0
                end
                if
                    21@ <> 1
                then
                    if
                        0D0C: get_car 1@ component "reversinglight_l" matrix_to 21@ // IF and SET
                    then
                        0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                        21@ -= 0x10
                        if
                            17@ < 0.0
                        then
                            0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.12 with_offsets 21@ intensity 80 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                            7@ += 1
                        end
                    end
                    if
                        0D0C: get_car 1@ component "reversinglight_l_2" matrix_to 21@ // IF and SET
                    then
                        0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                        21@ -= 0x10
                        if
                            17@ < 0.0
                        then
                            0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.12 with_offsets 21@ intensity 80 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                            7@ += 1
                        end
                    end
                    0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                    20@ += R_L
                    0A8C: 20@ 1 1 0 // TURN ON
                end    
                0AA8: call_function_method _getLightState struct 2@ num_params 1 pop 0 LIGHT_RIGHT 21@
                0441: 8@ = car 1@ model
                if
                    8A01: not model 8@ minimum_4wheels_vehicle
                then
                    21@ = 0
                end
                if
                    21@ <> 1
                then
                    if
                        0D0C: get_car 1@ component "reversinglight_r" matrix_to 21@ // IF and SET
                    then
                        0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                        21@ -= 0x10
                        if
                            17@ < 0.0
                        then
                            0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 0 1 150.0 0.12 21@ 100 255 255 255 0@ 7@
                            7@ += 1
                        end
                    end
                    if
                        0D0C: get_car 1@ component "reversinglight_r_2" matrix_to 21@ // IF and SET
                    then
                        0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                        21@ -= 0x10
                        if
                            17@ < 0.0
                        then
                            0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.12 with_offsets 21@ intensity 80 blue 255 green 255 red 255 to_vehicle_struct 0@ unical_number 7@
                            7@ += 1
                        end
                    end
                    0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
                    20@ += R_R
                    0A8C: 20@ 1 1 0 // TURN ON
                end
            end
        end
    end    
end
0AB2: ret 1 7@